import React from "react";
import "./HomeHead.less";
import timg from '../assets/images/timg.jpg'
const HomeHead = function HomeHead(props) {
  const {time}=props;
  let month=time.slice(4,6);
  const arr=['零','一','二','三','四','五','六','七','八','九','十','十一','十二'];
  arr.forEach((item,index)=>{
        if(+month==index){
          month=item
        }
  })
  const day=time.slice(6)
  return (
    <div className="homeHead">
      <div className="homeHeadLeft">
        <div>
          <p>{day}</p>
          <p>{month}月</p>
        </div>
        <h2>早点休息</h2>
      </div>
      <div className="avater">
        <img src={timg} alt="" />
      </div>
    </div>
  );
};
export default HomeHead;
